using System;
using System.Collections;
using System.Collections.Generic;

namespace demo_05
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello World!");
		}
		
		private readonly Record01[] DefaultList = new Record01[]
			{
				new Record01 {Id = 1, StrCol = "string1", BoolCol = false, NullBoolCol = true, NullDateCol = DateTime.Now},
				new Record01 {Id = 2, StrCol = "string2", BoolCol = false, NullBoolCol = true, NullDateCol = DateTime.Now},
				new Record01 {Id = 3, StrCol = "string3", BoolCol = false, NullBoolCol = true, NullDateCol = DateTime.Now},
				new Record01 {Id = 4, StrCol = "string4", BoolCol = false, NullBoolCol = true, NullDateCol = DateTime.Now},
				new Record01 {Id = 5, StrCol = "string5", BoolCol = false, NullBoolCol = true, NullDateCol = DateTime.Now},
			};
		
		public IList<Record01> GetList()
		{
			List<Record01> ls = new List<Record01>(DefaultList);
			return ls;
		}
		
	}
	
	public class Record01
	{
		public virtual Int64 Id {get; set; }
		public virtual string StrCol { get; set; }
		public virtual bool BoolCol { get; set; }
		public virtual bool? NullBoolCol { get; set; }
		public virtual DateTime? NullDateCol { get; set; }
		public virtual double FloatCol { get; set; }
		public virtual double? NullFloatCol { get; set; }
		public virtual Int32? NullIntCol { get; set; }
		
		public virtual double SumFloat()
		{
			if (NullFloatCol.HasValue)
				return FloatCol + NullFloatCol.Value;
			else
				return FloatCol;
		}
		
		public virtual DateTime? DatePlusInt()
		{
			if (NullDateCol.HasValue && NullIntCol.HasValue)
				return NullDateCol.Value.AddDays(NullIntCol.Value);
			else
				return null;
		}
		
	}
}

